<?php           
include("config/config.php"); 
$artista = htmlspecialchars(strip_tags(str_replace("20%"," ",$_GET['artista'])));
$genero =  htmlspecialchars(strip_tags(str_replace(" ","",$_GET['genero'])));
if($genero=="")
{
$consulta = mysql_query("SELECT * FROM Musica where  Artista = '".$artista."' ORDER BY RAND()");

}
else if($artista =="")
{
$consulta = mysql_query("SELECT * FROM Musica where  Genero = '".$genero."' ORDER BY RAND() LIMIT 100");
}
else 
{
	$consulta = mysql_query("SELECT * FROM Musica where  Artista  ORDER BY RAND() LIMIT 50");
}
	



echo "<Listas>";
while($musica = mysql_fetch_array($consulta))
{	  
echo "<song  cantante=\"".$musica['Artista']."\" titulo=\"".$musica['Tema']."\" />";
}
echo "</Listas>";




?>